import request from '@/utils/request'

// 注册组织
export function registerOrganization(data) {
  return request({
    url: '/organizations/register',
    method: 'post',
    data
  })
}

// 更新组织信息
export function updateOrganization(data) {
  return request({
    url: '/organizations/update',
    method: 'put',
    data
  })
}

// 审核组织
export function reviewOrganization(id, data) {
  return request({
    url: `/organizations/${id}/review`,
    method: 'post',
    params: data
  })
}

// 启用/禁用组织
export function toggleOrganization(id, enable) {
  return request({
    url: `/organizations/${id}/toggle`,
    method: 'post',
    params: { enable }
  })
}

// 删除组织
export function deleteOrganization(id) {
  return request({
    url: `/organizations/${id}`,
    method: 'delete'
  })
}

// 批量删除组织
export function batchDeleteOrganization(ids) {
  return request({
    url: '/organizations/batch',
    method: 'delete',
    data: ids
  })
}

// 获取组织列表
export function getOrganizationList(params) {
  return request({
    url: '/organizations/list',
    method: 'get',
    params
  })
}

// 获取组织详情
export function getOrganizationDetail(id) {
  return request({
    url: `/organizations/${id}`,
    method: 'get'
  })
} 